<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\UserRechargeBean;

class UserRechargeValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 UserRechargeBean::$id => 'require', //
			 UserRechargeBean::$orderNumber => 'require|max:0', //订单号
			 UserRechargeBean::$userId => 'require', //用户id
			 UserRechargeBean::$payPrice => 'require', //充值金额
			 UserRechargeBean::$givePrice => 'require', //赠送金额
			 UserRechargeBean::$realPrice => 'require', //实际到账金额
			 UserRechargeBean::$status => 'require', //充值状态 1 未支付，2取消支付，3支付成功
			 UserRechargeBean::$createdAt => 'require', //创建时间
		];
		$this->message = [
			UserRechargeBean::$id.POINST."require " => 'id必须', //
			UserRechargeBean::$orderNumber.POINST."require " => 'order_number必须', //订单号
			UserRechargeBean::$userId.POINST."require " => 'user_id必须', //用户id
			UserRechargeBean::$payPrice.POINST."require " => 'pay_price必须', //充值金额
			UserRechargeBean::$givePrice.POINST."require " => 'give_price必须', //赠送金额
			UserRechargeBean::$realPrice.POINST."require " => 'real_price必须', //实际到账金额
			UserRechargeBean::$status.POINST."require " => 'status必须', //充值状态 1 未支付，2取消支付，3支付成功
			UserRechargeBean::$createdAt.POINST."require " => 'created_at必须', //创建时间
		];
		$this->scene = [
			self::$all => [
				UserRechargeBean::$id,
				UserRechargeBean::$orderNumber,
				UserRechargeBean::$userId,
				UserRechargeBean::$payPrice,
				UserRechargeBean::$givePrice,
				UserRechargeBean::$realPrice,
				UserRechargeBean::$status,
				UserRechargeBean::$createdAt,
			],
			self::$add => [
			],
			self::$edit => [
			],
			self::$pkId => [],

		];
	}


}
